﻿using System;
using System.Linq;
using NUnit.Framework;
using ProjetoComperio.BusinessLogicLayer;
using ProjetoComperio.DataLayer.Entities;
using ProjetoComperio.DataLayer.Infra;
using ProjetoComperio.Test.FakeData;

namespace ProjetoComperio.Test.BusinessLogicLayer
{

    [TestFixture]
    public class PersonBLLTest
    {

        private PersonBLL personBLL;

        [SetUp]
        public void SetUp()
        {
            personBLL = new PersonBLL();
            //IComperioEntitiesDataModel model = new FakeComperioEntitiesDataModel();
            //model.IsInitialized = true;
            //personBLL.InitializeDataContext(model);
        }

        public Person GenerateValidTrackedEntityPerson()
        {
            Person person = new Person();
            person.Name = "Higor";
            person.Email = "higor@projetocomperio.org";
            person.Country = "Brasil";
            person.State = "RJ";
            person.Neighbourhood = "Vila da Penha";
            person.ZipCode = "21221120";
            person.Street = "Rua ABC";
            person.AddressNumber = "120";
            person.City = "Rio de Janeiro";
            person.WebPage = "webPage";
            person.BirthDate = DateTime.Today.Date;
            //   person.EducationLevel  //= new StudentBLLFacade().RetrieveEducationLevels().FirstOrDefault();
            return person;
        }

        [Test]
        public void TestRetrievePeople()
        {
            Assert.That(Is.Equals(personBLL.RetrievePeople().Count(), 4));
        }

        [Test]
        public void TestRetrieveEducationLevels()
        {
            Assert.AreEqual(3, personBLL.RetrieveEducationLevels().Count());
        }
    }
}
